<template>
  <el-form ref="basicInfoForm" :model="info" :rules="rules" label-width="150px">
    <el-row>
      <el-col :span="12">
        <el-form-item label="名称" prop="name">
          <el-input placeholder="请输入名称，如：Test" v-model="info.name" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="父类名称" prop="parentClass">
          <el-select
            v-model="info.parentClass"
            allow-create
            clearable
            default-first-option
            placeholder="请输入父类名称"
            style="width:350px"
          >
            <el-option
              v-for="item in parentClasses"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="注释" prop="comment">
          <el-input placeholder="请输入注释，如：测试" v-model="info.comment" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="父文件路径" prop="baseDirPath">
          <el-input placeholder="请输入父文件路径" v-model="info.baseDirPath" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="项目名称" prop="projectName">
          <el-input
            placeholder="请输入项目名称，如：Project"
            v-model="info.projectName"
          />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="接口名" prop="interfaces">
          <el-select
            v-model="info.interfaces"
            multiple
            filterable
            allow-create
            clearable
            default-first-option
            placeholder="请输入接口名称"
          >
            <el-option
              v-for="item in interfaces"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>

<script>
export default {
  props: {
    info: {
      type: Object,
      default: null
    }
  },
  data() {
    return {
      interfaces: [
        {
          value: {
            value: "IMultiTenant"
          },
          label: "IMultiTenant"
        }
      ],
      parentClasses: [
        {
          value: "FullAuditedAggregateRoot<Guid>",
          label: "FullAuditedAggregateRoot<Guid>"
        }
      ],
      value: []

      // rules: {
      //   tableName: [
      //     { required: true, message: "请输入表名称", trigger: "blur" }
      //   ],
      //   tableComment: [
      //     { required: true, message: "请输入表描述", trigger: "blur" }
      //   ],
      //   className: [
      //     { required: true, message: "请输入实体类名称", trigger: "blur" }
      //   ],
      //   functionAuthor: [
      //     { required: true, message: "请输入作者", trigger: "blur" }
      //   ]
      // }
    };
  },
  created() {
    this.info.parentClass = this.parentClasses[0].value;
    // this.info.interfaces = [this.interfaces[0].value];
  }
};
</script>
